package com.canbot.u05.view;


import android.app.Dialog;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import com.canbot.u05.R;

/**
 * 连接中,连接成功，第一次重连
 */
public class CenterDialog2 extends Dialog {

        public CenterDialog2(Context context, int id) {
                super(context, R.style.MyDialogStyle);
                setmenuDialog(id);
        }

        private void setmenuDialog(int id) {

                switch (id) {
                        case 0:
                                //正在连接机器人...
                                View connectingDialog = LayoutInflater.from(getContext()).inflate(R.layout.dialog_center_connecting, null);
                                setCancelable(false);
                                setContentView(connectingDialog);
                                break;
                        case 1:
                                //连接成功!
                                View connectSuccessDialog = LayoutInflater.from(getContext()).inflate(R.layout.dialog_center_connect_success, null);
                                setCancelable(false);
                                setContentView(connectSuccessDialog);
                                break;
                        case 2:
                                //正在重连机器人第一次...
                                View connectFirstDialog = LayoutInflater.from(getContext()).inflate(R.layout.dialog_center_connect_first, null);
                                setCancelable(false);
                                setContentView(connectFirstDialog);
                                break;
                        case 5:
                                //断开连接提示
                                View mobileingDialog2 = LayoutInflater.from(getContext()).inflate(R.layout.dialog_center_connecting, null);
                                TextView textView = (TextView) mobileingDialog2.findViewById(R.id.tv_tishi);
                                textView.setText("正在断开连接...");
                                setCancelable(false);
                                setContentView(mobileingDialog2);
                                break;
                        case 6:
                                //连接提示
                                View mobileingDialog3 = LayoutInflater.from(getContext()).inflate(R.layout.dialog_center_connecting, null);
                                TextView textView2 = (TextView) mobileingDialog3.findViewById(R.id.tv_tishi);
                                textView2.setText("即将控制机器人...");
                                setCancelable(false);
                                setContentView(mobileingDialog3);
                                break;
                        case 7:
                                //人脸库中没有信息
                                View vipDialog = LayoutInflater.from(getContext()).inflate(R.layout.dialog_center_connect_first, null);
                                TextView textView3 = (TextView) vipDialog.findViewById(R.id.tv_tishi);
                                textView3.setText("人脸库中还没有数据，请先去设置一下吧！");
                                setCancelable(false);
                                setContentView(vipDialog);
                                break;
                }
        }
}
